summaryrefslogtreecommitdiff
path: root/app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx')
-rw-r--r--app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx57
1 files changed, 57 insertions, 0 deletions
diff --git a/app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx b/app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx
new file mode 100644
index 00000000..0dfc578e
--- /dev/null
+++ b/app/[lng]/evcp/(evcp)/budgetary-ship/[id]/page.tsx
@@ -0,0 +1,57 @@
+import { Separator } from "@/components/ui/separator"
+import { type SearchParams } from "@/types/table"
+import { getValidFilters } from "@/lib/data-table"
+import { getMatchedVendors } from "@/lib/rfqs-ship/service"
+import { searchParamsMatchedVCache } from "@/lib/rfqs-ship/validations"
+import { MatchedVendorsTable } from "@/lib/rfqs-ship/vendor-table/vendors-table"
+import { RfqType } from "@/lib/rfqs-ship/validations"
+
+interface IndexPageProps {
+ // Next.js 13 App Router에서 기본으로 주어지는 객체들
+ params: {
+ lng: string
+ id: string
+ }
+ searchParams: Promise<SearchParams>
+ rfqType: RfqType
+}
+
+export default async function RfqPage(props: IndexPageProps) {
+ const resolvedParams = await props.params
+ const id = resolvedParams.id
+ const rfqType = props.rfqType ?? RfqType.BUDGETARY // rfqType이 없으면 BUDGETARY로 설정
+
+ const idAsNumber = Number(id)
+
+ // 2) SearchParams 파싱 (Zod)
+ const searchParams = await props.searchParams
+ const search = searchParamsMatchedVCache.parse(searchParams)
+ const validFilters = getValidFilters(search.filters)
+
+ const promises = Promise.all([
+ getMatchedVendors({
+ ...search,
+ filters: validFilters,
+ },
+ idAsNumber)
+ ])
+
+ // 4) 렌더링
+ return (
+ <div className="space-y-6">
+ <div>
+ <h3 className="text-lg font-medium">
+ Vendors & CBE
+ </h3>
+ <p className="text-sm text-muted-foreground">
+ 등록된 협력업체 중에서 이 RFQ 아이템에 매칭되는 업체를 선택하고 바로 CBE(상업적 견적) 요청을 발송할 수 있습니다. <br/>
+ 벤더를 선택한 후 &quot;CBE 요청&quot; 버튼을 클릭하면 첨부파일과 함께 CBE 요청이 해당 업체에 바로 발송됩니다.
+ </p>
+ </div>
+ <Separator />
+ <div>
+ <MatchedVendorsTable promises={promises} rfqId={idAsNumber} rfqType={rfqType}/>
+ </div>
+ </div>
+ )
+} \ No newline at end of file